﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class DataSourceInformationHelper
	 {
		  /// <summary>
		  /// The data source information
		  /// </summary>
		  private static DataTable dataSourceInformation = new DataTable("DataSourceInformation");

		  /// <summary>
		  /// Gets the data source information.
		  /// </summary>
		  /// <value>
		  /// The data source information.
		  /// </value>
		  public static DataTable DataSourceInformation
		  {
				get { return dataSourceInformation; }
		  }

		  /// <summary>
		  /// Gets the data source information.
		  /// </summary>
		  public static void GetDataSourceInformation()
		  {
				dataSourceInformation.Clear();
				dataSourceInformation = Utility.DBConnection.GetSchema("DataSourceInformation");

				//Utility.PrintDatatable(dataSourceInformation);
		  }

		  /// <summary>
		  /// Writes the data source information.
		  /// </summary>
		  public static void WriteDataSourceInformation()
		  {
				string xmlfile = dataSourceInformation.TableName + ".xml";
				string xslFile = dataSourceInformation.TableName + ".xsl";
				string htmFile = dataSourceInformation.TableName + ".htm";

				Utility.WriteXML(dataSourceInformation, dataSourceInformation.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}